package com.xuhj.service;

import com.xuhj.pojo.Dept;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

import java.util.List;

// 提供者服务的名字
@Service
//fallbackFactory = DeptClientHystrix.class服务降级处理
@FeignClient(value = "SPRINGCLOUD-PROVIDER-DEPT",fallbackFactory = DeptClientHystrix.class)
public interface DeptClientService {

    @GetMapping("/dept/get/{deptno}")
    public Dept queryById(@PathVariable("deptno") Long id);

    @GetMapping(value = "/dept/list")
    public List<Dept> queryAll();

    @PostMapping(value = "/dept/add",produces = "application/json;charset=UTF-8")
    public Boolean addDept(Dept dept);


}
